package com.mybindview.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.mybindview.R;
import com.mybindview.adapter.RecyclerAdapter;
import com.mybindview.databinding.ActivityRecyclerviewBinding;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by nbzl on 2017/2/27.
 */
public class RecyclerviewActivity extends AppCompatActivity {
    private RecyclerAdapter adapter;
    private List<String> list=new ArrayList<String>();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityRecyclerviewBinding binder= DataBindingUtil.setContentView(this, R.layout.activity_recyclerview);
        for(int i=0;i<20;i++){
            list.add("-->"+i);
        }
        adapter=new RecyclerAdapter(this,list);
        binder.recyclerview.setAdapter(adapter);
        binder.title.setText("标题");
    }
}
